<?php
class AtomFeedStyle extends AbsFeedStyle {
	public function html() {
		$title = $this->encode($this->data['title']);
		$link = $this->data['link'];
		$updated = $this->encode($this->data['updated']);
		$author = $this->encode($this->data['author']);
		$id = $this->encode($this->data['id']);
		
		$atom = "<?xml version=\"1.0\" encoding=\"utf-8\"?>
		<feed xmlns=\"http://www.w3.org/2005/Atom\">
		
			<title>{$title}</title> 
			<link href=\"{$link}\"/>
			<updated>{$updated}</updated>
			<author> 
				<name>{$author}</name>
			</author> 
			<id>{$id}</id>";
			
		foreach($this->data['entrys'] as $entry) {
			$title = $this->encode($entry['title']);
			$link = $entry['link'];
			$id = $this->encode($entry['id']);
			$updated = $this->encode($entry['updated']);
			$summary = $this->encode($entry['summary']);
			
			$atom .= "<entry>
				<title>{$title}</title>
				<link href=\"{$link}\"/>
				<id>{$id}</id>
				<updated>{$updated}</updated>
				<summary>{$summary}</summary>
			</entry>";
		}
		
		$atom .= "</feed>";
		
		return $atom;
	}
}
?>